This project is a computational analysis of emotion in selected twentieth century literary texts. Owing to the subjective nature of emotion, it is typically analysed through close reading of texts only. But the use of a data-driven method forces us to think about different questions. What are the ways in which emotions are written? How do they differ across authors, subjects, and times? Which characters, genres and narratives are they most associated with? How does one quantify emotion? If emotion is indeed quantifiable, how does that change the focus of literary studies and stylistic analysis?
We will briefly explore some of these questions in our analysis of F. Scott Fitzgerald and Ernest Hemingway. We aim to use data to find out which author’s work is more emotional, and why. We are also interested in exploring how these emotions manifest in and around the protagonists of these novels.
The novels of F. Scott Fitzgerald contain more emotion than the novels of Earnest Hemingway.
We undertook a comparative study of Ernest Hemingway and F. Scott Fitzgerald’s novels. The corpus was created based on availability. Hemingway’s works were not on available on Gutenberg, and had to be obtained from a different resource. The files thus obtained were not clean, and contained textual artifacts. The files were cleaned thoroughly so as to prevent issues in analysis. Since Fitzgerald has only 4 finished novels, we obtained 4 novels of Hemingway as well. But the word count differed drastically, so we added Hemingway’s Garden of Eden to reach desirable balance in wordcount.
Despite this minor setback, we were optimistic that we would find interesting results, for two reasons. Firstly, both authors wrote in the early 1900s, during what was called the “Jazz Age”, but in very different styles, and about very different subject matter. Fitzgerald’s world held soirees, idle wealth, and hedonism; while Hemingway’s held grit, frugality, and violence. Their writing styles are also quite distinct, with Hemingway’s work being characterized by its short, clipped sentences, devoid of adverbs, and Fitzgerald’s with more verbose, descriptive writing. What they do have in common is a picture of post-war industrialist America, wrought with disillusionment but slowly rebuilding.
In such a dynamic setting, we thought it worthwhile to do a reading of emotion in the works of both authors. Both literature and affect do, after all, lie at the intersection of the individual and the social. Our methodology then became two-pronged. One one hand, we conducted a stylistic study of the writing of emotions; and on the other, we conducted a contextual analysis of how characters in various social worlds feel and interact with these emotions. Our texts for each author are as follows:
| Hemingway | Fitzgerald |
|---|---|
| The Old Man and the Sea | This Side of Paradise |
| A Farewell to Arms | The Great Gatsby |
| For Whom the Bell Tolls | Tender is the Night |
| The Sun Also Rises | The Beautiful and Damned |
| The Garden of Eden |
We used five texts for Hemingway and four for Fitzgerald to analyse the presence of emotion in their texts. The corpus is close to 800,000 words long, which is just shy of the 1 million mark considered adequate. Our choice of the authors limited our options, but we excitedly proceeded with our corpus.
The length of the novels by the authors varied considerably, with two shorter novels by both authors included - The Old Man and the Sea for Hemingway, at approximately 28,000 words, and The Great Gatsby at 48,700 words, as well as longer novels.
Fitzgerald’s novels have a higher vocabulary density (ratio of words in the novel to unique words in the novel), and sentence length as compared to Hemingway’s. For Fitzgerald’s novels, the vocabulary density ranges from 0.097 to 0.122 while for Hemingway’s novels this value ranges from 0.049 to 0.099. This indicates that Hemingway used a more comfortable vocabulary, while Fitzgerald incorporated more unique words in his writing. The difference in their writing styles and choice of unique words fit well with our intuition about Fitzgerald’s work being more descriptive and employing more complex, verbose language. This also applies to the sentence length, with Fitzgerald’s average words per sentence ranging from 14.7 to 15.9, while for Hemingway this value ranged from 8.8 to 14.4. This seems reflective of the differences in their writing styles.
With regard to unique terms, in all novels except for The Old Man and the Sea, the most unique terms are character names. Interestingly, The Old Man and the Sea is the exception to this trend, probably because of the limited human characters in the book, with terms like dolphin and shark standing out as distinctive words.
Thus, our corpus summary seems to indicate that our intuition about the differences between Hemingway’s and Fitzgerald’s writing style seems accurate, and our subsequent sections will focus on how emotions are expressed in these differing writing styles.
In qualitative reading of literature, it is easy to question what it means for one text to be more emotional than another. One may argue that even simple descriptive paragraphs have emotion attached to them. But it is important to note that our tools are only equipped tell us which author’s work is more overtly emotional: that is, which author’s work will let us decipher emotion without having to analyse subtext or metaphors. Close reading may or may not corroborate our findings, and lack of emotion in our findings definitely does not mean that an author employs less emotion in his writing.
For this task, we created a lexicon with handpicked words to represent various emotions. These include basic, broad ones like joy and anger, but also more specific ones such as pride and resentment. We also employed code to generate variations of these words, including adverbs, and thus we had a sizable number of unique emotion words at our disposal. However, since this lexicon has been manually compiled, the possibility that some useful words were missed always lingers.
We first matched these words with each author’s corpus, and calculated their occurence. To get a more accurate picture, we further divided this number by the total number of words in each author’s corpus. The relative frequency provides interesting insights.
As the graph indicates, Fitzgerald work has a higher percentage of these emotion words. His least emotional novel, The Great Gatsby, with only 2.5% of the words matching our lexicon, is still higher than Hemingway’s most emotional novel – A Farewell To Arms, which stands at 2.1%. The Old Man and The Sea has the lowest score of the corpus.
The reason for Hemingway’s scores is largely stylistic. Because a lot of emotion is embedded in adverbs, a good percentage of our lexicon consists of adverbs, which are exactly what Hemingway’s writing lacks. A lot of Hemingway’s characters are also hypermasculine and shy away from explicit expression of their emotions. In fact, if one were to read closely, it is by means of this stoic masculine facade that their true feelings can be deciphered. Our tools, however, lack the ability to detect subtext and decipher metaphors, analogies, irony, sarcasm, and the likes. Even when reading at a sentence- or paragraph-level, the tools are ill-equipped to decode a non-explicit expression of emotion.
Fitzgerald’s relatively higher percentage is reflective of his writing style, and the larger themes in his novels. His writing style is more descriptive, and he freely employs complex expressions that stitch multiple metaphors together. His novels also focus on the emotional bonds between characters, especially within the context of romantic relationships, which may have contributed to his higher score. Several of his male main characters have romantic relationships which provide a space for the important themes in the book to emerge through, making it important for the writing and descriptions of the same to be detailed.
While sentiment analysis using NRC provided us a powerful picture of which emotions dominate an author’s work, we wanted to further inquire into where and who they originated from. Hence, we performed Named Entity Recognition to locate the persons in the text. Then we performed sentiment analysis on the text surrounding these entities to find emotional valences. We employed the NRC lexicon again, because we wanted to maintain consistency with prior analyses, and NRC was best suited for our needs because of its comprehensive lexicon.
It is difficult to extract the protagonist through computational means, so we relied on external resources to compile a list of protagonists of each novel. This method is not suited for a corpus that has thousands of books, but since we had only 9 works in our corpus, we chose this route. The NER tagging worked well for extracting entities, but the text had to be manually scrubbed line-by-line to fix the errors. The amount we learned about each protagonist varied, with some novels providing great insights into their emotional content, but some, such as The Old Man and The Sea still withheld their secrets.
Hemingway’s protagonists appear to consistently have higher scores for trust, as compared to other emotions. Interestingly, despite his protagonists being presented as extremely “masculine” characters, thrust in situations of wars, or grappling with the dangers of nature, they score higher on trust than they do on anger. On the whole, the characters seem well balanced, with one exception – Henry. Sadness and trust, and in one case fear appear to be prominent emotions. This yields an interesting insight about these characters and the manner in which Hemingway thought about masculinity in the post war era he was writing in. Trust is an emotion that is relational - it emerges within the context of relationships, or a cause, and is thus an indicator of the same in novels. As demonstrated by characters such as Henry from A Farewell to Arms, the emphasis on trust could be a product of the relationships, and the emphasis on men ‘finding themselves’ and in the case of the novel, bidding goodbye to war to embrace a life of love instead. Thus, the comparatively high scores for trust could be a product of the relationships exhibited in Hemingway’s novels. Hemingway’s choice to make his main characters masculine, but also not intensely angry, allows him to create characters who experience complex emotional conflict, and thus, cannot be typecast as one-dimensional characters.
However, despite this, Hemingway’s characters express more anger than Fitzgerald’s (except for Dick Diver), which fits with our assumptions about them. It is possible that Hemingway’s characters may not have a higher expression of anger when compared to his peers’, but for our narrow hypothesis they do appear to be more highly associated with anger than Fitzgerald’s characters.
Fitzgerald’s protagonists score high on trust and anticipation as compared to other emotions. This is likely the result of a focus on romantic relationships in his books. Further, these relationships are presented as causing the downfall of the male protagonist – emphasising on the presence (or absence) of trust in these relationships. The high score for anticipation could be a product of two factors – first, the male character’s yearning for a particular female character, and second, the build up to the protagonist’s downfall. The main characters’ longing for a female character can be seen in the The Great Gatsby, where Gatsby would hold parties in anticipation of Daisy coming to them. Similarly, the build up to the characters’ downfall can be observed in Tender is the Night, where the reader is witness to Dick Diver’s slow fall from grace.
His protagonists also feel more joy than sadness (barring Dick Diver), and this contrasts our assumption that Fitzegerald’s novels would have more melancholic characters. However, apart from Gatsby, none of them particularly feel surprise, which is, if we may, quite surprising. Partly because the protagonist of any story typically has unforeseen events happen to them, and thus is surprised to at least some extent; and partly because many of Fitzgerald’s protagonists go through similar situations as Gatsby, in terms of being abandoned by a lover. Perhaps it is Gatsby’s murder that skews the results, or perhaps the other protagonists are simply not surprised by these events. It is also likely that surprise may not be an emotion that has strong associations with the words used to capture it. For example, the phrase “Oh my God”, stripped of “Oh”, may not be accounted for, especially when the sentiments focus on unigrams. A better approach would be to include bigrams, but that is also true for other emotions.
Our analysis also produced a list of the most positive and negative characters in each novel, created through sentiment analysis that generated a score for each of them. Scores on the positive end mean the character had positive emotions associated with them, while negative scores mean the opposite. This provides insights into how emotion and gender was linked. Fitzgerald has more negative women than positive women. This could be reflective of how his female characters influenced the protagonists’ lives, such as in the case of The Great Gatsby and Tender is the Night, where they’re presented as the cause for the protagonist’s downfall. He presents these romantic relationships as being all consuming, with the woman either cheating on the protagonist, or even indirectly causing his death. Some of Fitzgerald’s female characters, such as Nicole Diver are also presented with a history of mental illness, which contributes to the assignment of negative sentiments to them.
Hemingway, on the other hand, has more positive female characters. This could be reflective of the idealised image of women his protagonists have, where they are put on moral pedestals that also become cages. Some female characters in Hemingway were incredibly submissive and obedient, which he saw as a thing of great value. One such character is Catherine from A Farewell to Arms – but interestingly, she does not appear in the list of most positive characters from the novel. The two women that do appear are her colleagues, who are secondary to the main romance. It may be worth exploring this further, through computing correlations, to see why secondary characters have more emotion surrounding them. How sentences are broken down and associated with entities plays a very important role in this technique of analysis.
Our research has shown that Fitzgerald’s works have more expression of emotion than Hemingway’s. The hypothesis has held its ground despite all the different ways of analysis that were hurled at it. The first result, generated by using a curated list of words, shows that, assuming the lexicon was broad but also specific enough to capture different emotions in text, Fitzgerald’s novels contain more emotional content. The second result, aided by the NRC lexicon, does not provide conclusive results. Both authors cover a wide ground, and are tilted towards different emotions. However, this result appears skewed owing to the absence of adverbs. Fitzgerald’s prose – rich in metaphor, splattered with creative adverbs – loses its sheen when placed under the microscope of this analysis. We are wary about accepting this result, and hope that a richer lexicon might capture what escaped us.
The NER analysis combined with sentiment analysis, however, gives us a clearer picture. Fitzgerald’s characters do appear to have emotional valences significantly higher than Hemingway’s characters. While Hemingway’s protagonists are more balanced in emotion than Fitzgerald’s protagonists, it seems that this very characteristic of Fitzgerald’s characters, their overt tilt towards specific emotions, are reflective of the high emotional density of his works. His verbosity in expression appears to contribute to detection of explicitly emotional content of his novels.
Thus, we conclude that by using both a specific and general lexicon, accurately extracting entities, and assigning meaningful sentiment value to the characters, we have found Fitzgerald’s works to be richer in emotion. With that said, better tools and a more fine-grained analysis is required to substantiate without doubt which author’s work are richer in emotional content.
R provided us with tools to view the texts and an author’s work at a macro level, and allowed us to deal with a large quantity of data in a short period of time. This was useful as it presented trends across novels for different authors. The visualisations also allowed for the easy analysis and presentation of findings. Given that the main rule of writing is to show, not tell readers how a character feels, one may wonder if these are worthwhile tools to explore emotion at all, considering they only pick up on what is explicitly told to them. But they are very powerful tools to analyse writing style as well as emotion in relation to other variables in the text, like gender or character.
The activity involved moving away from a typical close reading of literature, which presented its own challenges. A significant issue revolved around how emotion lexicons and sentiment scores are not useful for picking up on subtext. It cannot measure emotions expressed through metaphors, details of non verbal expressions in books and some dialogues. It is more useful at identifying more overt methods of expressing emotion. Along with this, it is difficult for even the most elaborate emotional lexicons to be entirely comprehensive, indicating the possibility that several expressions of emotion could have been missed.
Another issue with our analysis was related to how we generated an overall emotion score, instead of understanding sentiment around a concept (such as sentiment around war in novels). This proved to be slightly broad, as compared to drilling down on a topic, however, it was appropriate for our hypothesis which sought to explore emotion in the writing styles of the authors.
On a more granular level, having the ability to wrangle data in endless ways proved to be a huge advantage. Testing various ideas by restructuring data in creative ways was a swift process. We were able to generate a multitude of visualisations by making very minor changes in code, which sped up the ideation and the subsequent verification process. One glaring flaw, though, was the NER process. In joining entities with sentences, the code relied on partial matches, which led to entities being attached to wrong sentences. And manually combing through and cleaning the data was a tedious and very time consuming task. Perhaps a better way could be devised to computationally attach entities to the right sentences.